<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>记账簿 - 支出</title>
  <!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
  <script src="libs/jquery-1.12.1.min.js"></script>
  <link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
  <script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
  <div class="container">
    <div class="row">
      <div class="col-md-12 page-header">
        <h2 class="text-center">记账簿<br/><small>用户支出</small></h2>
      </div>
    </div>
  </div>
  <div class="container">
  <div class="row">
    <div class="col-md-8">
      <ul class="nav nav-pills">
        <li >
        <a href="index.html"><strong>首页</strong></a>
        </li>
        <li  class="active">
        <a href="moneyOut.html"><strong>新加支出</strong></a>
        </li>
        <li>
        <a href="moneyIn.html"><strong>新加收入</strong></a>
        </li>
         <li>
        <a href="statis.html"><strong>统计</strong></a>
        </li>
            <li>
        <a href="query.html"><strong>查询</strong></a>
        </li>
         <li >
     <a href="login.html"><strong>(切换)用户：</strong><span id="text3"></span></a>
        </li>
      </ul>
    </div>
  </div>
</div>
  <div class="container">
    <div class="row">
      <div class="col-md-4 col-md-offset-4">
        <div class="form-group">
          <label for="place">地点</label>
          <input type="text" class="form-control" id="place"/>
        </div>
        <div class="form-group">
          <label for="kind">类别</label>
          <input type="text" class="form-control" id="kind"/>
        </div>
        <div class="form-group">
          <label for="money_out">金额</label>
          <input type="text" class="form-control" id="money_out"/>
        </div>
         <div class="form-group">
          <label for="remark">备注</label>
          <input type="text" class="form-control" id="remark"/>
        </div>
         <div class="form-group">
          <label for="date_time">时间</label>
          <input type="date" class="form-control" id="date_time"/>
        </div>
        <button id="moneyOut" class="btn btn-primary btn-block">提交</button>
      </div>
    </div>
  </div>
  <script type="text/javascript">
  $(function () {
	  $.getJSON('queryuser.action', function(res){
	       
	       $('#text3').text(res.nickname);   
});
	    $('#moneyOut').click(function () {
	        $.post('moneyOut.action',{
	        place: $('#place').val(),
	        kind: $('#kind').val(),
	        money_out: $('#money_out').val(),
	        remark:$('#remark').val(),
	        date_time:$('#date_time').val()
	      }, function (res, status) {
	        if ('OK' == res) {
	        window.location.href="index.html"
	        } 
	      });
	    });
	  });
  </script>
</body>
</html>
